class MovieManager{
    private static _instance:MovieManager = null;
    private fruit_boom_factory:egret.MovieClipDataFactory;
    private _fruitPool:egret.MovieClip[] = [];

    constructor()
    {

    }

    public static instance():MovieManager
    {
        if(!MovieManager._instance)
        {
            MovieManager._instance = new MovieManager();
        }
        return MovieManager._instance;
    }

    public getFruitMovie(moveName)
    {
        if(!this.fruit_boom_factory)
        {
            this.fruit_boom_factory = new egret.MovieClipDataFactory(RES.getRes('fruit_gif_json'), RES.getRes('fruit_gif_png'));
        }
        let mc = new egret.MovieClip(this.fruit_boom_factory.generateMovieClipData(moveName));
        mc.name = moveName;
        return mc;
    }

    public getGifByName(name, moveName)
    {
        let factory = new egret.MovieClipDataFactory(RES.getRes(name+'_json'), RES.getRes(name+'_png'));
        let mc = new egret.MovieClip(factory.generateMovieClipData(moveName));
        mc.name = moveName;
        return mc;
    }
}